﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace kongjian44
{
    [Designer(typeof(TongJi_EMS._TJ_Basic.TJ_BasicControlDesigner))]
    public partial class dianyahugan10kv : TongJi_EMS._TJ_Basic.TJ_BasicControl
    {
        public dianyahugan10kv()
        {
            InitializeComponent();
            this.NeedPoint = true;
        }
        private string faultSignal = "0";//故障信号
        [CategoryAttribute("Data")]
        [Description("变压器故障信号，0为正常状态，1为故障状态")]
        public string FaultSignal
        {
            get { return faultSignal; }
            set { faultSignal = value; }

        }
        private string ua = "0";//电压信号
        [CategoryAttribute("Data")]
        public string Ua
        {
            get { return ua; }
            set { ua = value; }

        }
        private string ub = "0";//电压信号
        [CategoryAttribute("Data")]
        public string Ub
        {
            get { return ub; }
            set { ub = value; }

        }
        private string uc = "0";//电压信号
        [CategoryAttribute("Data")]
        public string Uc
        {
            get { return uc; }
            set { uc = value; }

        }
        private void dianyahugan10kv_Paint(object sender, PaintEventArgs e)
        {
            Pen a = new Pen(CtrColor, 1);
            e.Graphics.DrawLine(a, x, 0, x, y * 0.2f);
            e.Graphics.DrawEllipse(a, x * 0.25f, y * 0.2f, x * 1.5f, x * 1.4f);
            e.Graphics.DrawLine(a, x, y * 0.4f, x, y * 0.7f);
            e.Graphics.DrawLine(a, x * 0.6f, y * 0.85f, x, y * 0.7f);
            e.Graphics.DrawLine(a, x * 1.4f, y * 0.85f, x, y * 0.7f);


            e.Graphics.DrawEllipse(a, x * 0.25f, y * 1.8f - x * 1.4f, x * 1.5f, x * 1.4f);
            e.Graphics.DrawLine(a, x, y * 1.2f, x, y * 1.45f);
            e.Graphics.DrawLine(a, x * 0.6f, y * 1.6f, x, y * 1.45f);
            e.Graphics.DrawLine(a, x * 1.4f, y * 1.6f, x, y * 1.45f);
            e.Graphics.DrawLine(a, x, y * 1.8f, x, y * 2.0f);

            e.Graphics.DrawLine(a, x * 0.9f, y * 0.1f, x * 1.1f, 0);
            e.Graphics.DrawLine(a, x * 0.9f, y * 0.15f, x * 1.1f, y * 0.05f);

            e.Graphics.DrawLine(a, x * 0.9f, y * 1.9f, x * 1.1f, y * 1.85f);
            e.Graphics.DrawLine(a, x * 0.9f, y * 1.95f, x * 1.1f, y * 1.9f);

            Pen c = new Pen(Color.White, 3);
            if (faultSignal == "1")
            {

                e.Graphics.DrawRectangle(c, x * 0.1f, y * 0.1f, x * 1.8f, y * 1.8f);

            }
        }

        private void dianyahugan10kv_Resize(object sender, EventArgs e)
        {
            this.x = this.Width / 2;
            this.y = this.Height / 2;
            //this.Refresh();

        }

        private void dianyahugan10kv_Load(object sender, EventArgs e)
        {
            dianyahugan10kv_Resize(sender, e);
        }




    }
}